import { createRouter, createWebHistory } from 'vue-router'

import login from "../components/login.vue"
import home from "../components/home.vue"

import user from "../components/administer/user.vue"
import article from "../components/administer/article.vue"
import notice from "../components/messages/Notice.vue"
import message from "../components/messages/message.vue"
import advertising from "../components/messages/advertising.vue"

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/', component: login,
            meta: { loginType: false }
        },
        {
            path: '/home', component: home,
            children: [
                { path: '', redirect: "/home/user" },
                { path: 'user', component: user },
                { path: 'article', component: article },
                { path: 'notice', component: notice },
                { path: 'message', component: message },
                { path: 'advertising', component: advertising },
            ],
            meta: { loginType: true }
        },
    ],
})

export default router